package com.desarrollosjdc.clasificados.service;

public class PersistenceContextSingleton {
	/** MessageResource implementation to be injected  */
	private PersistenceContext persistenceContext = new PersistenceContext();
   
	/** singleton instance */
	private static PersistenceContextSingleton singleton = new PersistenceContextSingleton();
	/**
	 * Gets singleton
	 * @return singleton
	 */
	public static PersistenceContextSingleton getInstance(){
		return singleton;
	}
	/**
	 * Setter for the MessageResource implementation used to inject
	 * the implementation
	 * @param messageResource
	 */
	/*public void setPersistenceContext(PersistenceContext persistenceContext) {
		this.persistenceContext = persistenceContext;
	}*/
	/**
	 * Delegates the call to the injected implementation
	 * @param args arguments
	 * @return message
	 */
	public Object getBean(String key) {   	
		return persistenceContext.getBean(key);
	}
}